import 'package:flutter/material.dart';
import 'package:flutterproject/mvvm/base/base_state.dart';
import 'package:flutterproject/page/login_all/forget_pwd/children/forget_pwd_set/controller/forget_pwd_set_controller.dart';
import 'package:flutterproject/page/login_all/login/login_page.dart';
import 'package:flutterproject/page/login_all/login/widget/input_eye.dart';
import 'package:flutterproject/util/dialog_toast/toast_util.dart';
import 'package:flutterproject/util/extension/int_extension.dart';
import 'package:flutterproject/util/margin_padding_util.dart';
import 'package:flutterproject/widget/button_common.dart';
import 'package:flutterproject/widget/text/text_common.dart';
import 'package:get/get.dart';

class ForgetPwdSetPage extends BaseState<ForgetPwdSetController> {
  @override
  ForgetPwdSetController initController() => ForgetPwdSetController();

  @override
  Widget initView(BuildContext context) {
    return Container(
      width: Get.width,
      height: Get.height,
      color: Colors.white,
      padding: MarginPaddingUtil.symmetric(horizontal: 50),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          237.heightBox,
          TextCommon(
            "找回密码",
            size: 50.sp,
            color: Color(0xFFFF242429),
            fontWeight: FontWeight.bold,
          ),
          172.heightBox,
          Column(
            children: [
              InputEye(
                hint: '设置新的登录密码',
                isShowEye: true,
                onchange: (value) {
                  controller.pwd = value;
                  controller.isCorrect();
                },
              ),
              20.heightBox,
              InputEye(
                hint: '重复登陆密码',
                isShowEye: true,
                onchange: (value) {
                  controller.pwdConfirm = value;
                  controller.isCorrect();
                },
              ),
            ],
          ),
          Spacer(),
          GetBuilder<ForgetPwdSetController>(
              id: "confirm",
              builder: (logic) {
                return ButtonCommon(
                  text: "确认",
                  onTap: () => controller.onConfirm(),
                  fontSize: 32.sp,
                  fontColor: Colors.white,
                  color: controller.isCorrectPwd
                      ? Color(0xFFEDC88B)
                      : Color(0xFF6E6E6E).withOpacity(0.5),
                  borderRadios: 50,
                  padding: MarginPaddingUtil.only(top: 25, bottom: 29),
                );
              }),
          36.heightBox
        ],
      ),
    );
  }
}
